#pragma once

#include <typedef.h>

#if defined(CONFIG_TAR4ESP32)
#include "esp_adc/adc_cali.h"
#include "esp_adc/adc_cali_scheme.h"
#include "esp_adc/adc_oneshot.h"
#endif

typedef enum
{
	E_ADC1 = 0,
	E_ADC2
} E_ADC;

class ADC
{
public:
	ADC(int adc, int* chs, int size);
	virtual ~ADC();
	virtual int Transfer(uint16_t& result, int adc, int channel);

private:
#if defined(CONFIG_TAR4ESP32)
	adc_oneshot_unit_handle_t adc1_handle;
	adc_oneshot_unit_handle_t adc2_handle;
	adc_oneshot_unit_init_cfg_t init_config1;
	adc_oneshot_unit_init_cfg_t init_config2;
	adc_oneshot_chan_cfg_t config1;
	adc_oneshot_chan_cfg_t config2;
#endif
};